<!--{template common/header}-->
<!--{if $_G['gp_task']=='blockclass'}-->
	<div class="tbmu mbm" id="contentblockclass_nav" style="margin-top: -15px">
		<!--{eval $isfirst=1;}-->
		<!--{loop $_G['cache']['blockclass'] $key $value}-->
		<!--{if $isfirst}-->
		<!--{eval $isfirst=0;}-->
			<a href="javascript:;" id="bcnav_$key" class="a" onclick="spaceDiy.switchBlockclass('$key');return false;">{lang block::$value[name]}</a>
		<!--{else}-->
		<span class="pipe">|</span>
			<a href="javascript:;" id="bcnav_$key" onclick="spaceDiy.switchBlockclass('$key');return false;">{lang block::$value[name]}</a>
		<!--{/if}-->
		<!--{/loop}-->
	</div>
	<!--{eval $isfirst=1;}-->
	<!--{loop $_G['cache']['blockclass'] $key $value}-->
	<!--{if $isfirst}-->
	<!--{eval $isfirst=0;}-->
	<ul class="blocks content" id="contentblockclass_$key">
	<!--{else}-->
	<ul class="blocks content" id="contentblockclass_$key" class="hide">
	<!--{/if}-->
		<li class="module-$key">
			<ol>
			<!--{loop $value[subs] $skey $svalue}-->
				<li class="module-$skey"><label onmousedown="drag.createObj (event,'block','$skey');" onmouseover="className='hover';" onmouseout="this.className='';">{lang block::$svalue[name]}</label></li>
			<!--{/loop}-->
			</ol>
		</li>
	</ul>
	<!--{/loop}-->

<!--{elseif $_G['gp_task'] == 'import'}-->
<h3 class="flb">
	<em id="return_$_G[gp_handlekey]">{lang diy::Import frame}</em>
	<span>
		<!--{if $_G[inajax]}--><a href="javascript:;" class="flbc" onclick="hideWindow('$_G[gp_handlekey]');return false;" title="{lang Close}">{lang Close}</a><!--{/if}-->
	</span>
</h3>

<form name="frameimport" id="frameimport" enctype="multipart/form-data" method="post" autocomplete="off" action="index.php?option=diy&op=import" onsubmit="ajaxpost('frameimport','return_$_G[gp_handlekey]','','onerror',$$$('frameimportbutton'));">
	  <div class="c" style="width:420px;line-height:100px; overflow-y: auto; ">
		{lang diy::The location of a text file} <input type="file" id="importfile" name="importfile" style="margin: 5px;">
	</div>
	<div class="o pns">
		<input type="hidden" name="handlekey" value="$_G['gp_handlekey']" />
		<input type="hidden" name="importsubmit" value="true" />
		<input type="hidden" name="tpl" value="$_GET['tpl']" />
		<input type="hidden" name="formhash" value="{FORMHASH}" />
		<button type="submit" class="pn pnc" id="frameimportbutton"><strong>{lang Import}</strong></button>
	</div>
</form>
<script type="text/javascript" reload="1">
function succeedhandle_$_G['gp_handlekey'] (url, message, values) {
	if (values['status'] == '1') {
		if (values['css']) spaceDiy.initDiyStyle(values['css']);
		
		var areaArr = values['html'];
		var dom = document.createElement("div");
		for (var i in areaArr) {
			var html = areaArr[i].replace(/\[script/g, '<script').replace(/\[\/script\]/g, '<\/script>');
			var area = $$$(i) ? $$$(i) : $$$(drag.moveableArea[0]);
			dom.innerHTML = html;
			var arr = [];
			for (var i=0, l=dom.childNodes.length; i < l; i++) {
				arr.push(dom.childNodes[i]);
			}
			var one = '';
			while(one = arr.pop()) {
				Util.insertBefore(one,area.firstChild);
			}
		}
		drag.initPosition();
		drag.isChange = true;
		drag.setClose();
		var blocks = values['bids'].split(',');
		drag.blockForceUpdateBatch(blocks);
	}

	hideWindow('$_G['gp_handlekey']');
}
</script>
<!--{/if}-->
<!--{template common/footer}-->